﻿using System;

namespace AMS.Inventory.Entities
{
    /// <summary>
    /// 盘点相关基础信息(如,地点名称,类型名称)
    /// </summary>
    public class BaseDataInfo
    {
        protected Guid m_Id;
        /// <summary>
        /// 数据唯一标识
        /// </summary>
        public virtual Guid Id
        {
            get { return m_Id; }
            set { m_Id = value; }
        }
        protected string m_ClassName;
        protected string m_KeyVal;

        protected string m_KeyVal2;

        protected string m_KeyVal3;

        /// <summary>
        /// 基础数据的关键属性
        /// </summary>
        public virtual string KeyVal
        {
            get { return m_KeyVal; }
            set { m_KeyVal = value; }
        }

        /// <summary>
        /// 基础数据的关键属性2
        /// </summary>
        public virtual string KeyVal2
        {
            get { return m_KeyVal2; }
            set { m_KeyVal2 = value; }
        }

        /// <summary>
        /// 基础数据的关键属性3
        /// </summary>
        public virtual string KeyVal3
        {
            get { return m_KeyVal3; }
            set { m_KeyVal3 = value; }
        }


        /// <summary>
        /// 对应的主体对象名称
        /// </summary>
        public virtual string ClassName
        {
            get { return m_ClassName; }
            set { m_ClassName = value; }
        }

        protected string m_TypeName;
        /// <summary>
        /// 对应的主体类别名称
        /// </summary>
        public virtual string TypeName
        {
            get { return m_TypeName; }
            set { m_TypeName = value; }
        }

        /// <summary>
        /// 重写Equals方法
        /// </summary>
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(obj, this))
                return true;
            if (obj == null)
                return false;
            var sObj = obj as BaseDataInfo;
            return sObj != null && (sObj.Id == m_Id);
        }

        /// <summary>
        /// 重写GetHashCode方法
        /// </summary>
        public override int GetHashCode()
        {
            int hash = 199;
            hash = 15 * hash * m_Id.GetHashCode();
            return hash;
        }
    }
}